class Users {
  final String? uid;
  final String? username;
  final String? gid;
  final String? groupName;
  final String? password;

  Users( {
    this.uid,
    this.username,
    this.gid,
    this.groupName,
    this.password,
  });

  // 对象转JSON
  Map<String, dynamic> toJson() {
    return {
      'username': username,
      'uid': uid,
      'gid': gid,
      'groupName': groupName,
      'password': password ?? ''
    };
  }

  factory Users.fromJson(Map<String, dynamic> json) {
    return Users(
      password: json['password'].toString(),
      username: json['username'].toString(),
      uid: json['oid'].toString(),
      gid: json['gid'].toString(),
      groupName: json['groupName'].toString(),
    );
  }
}
